﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ext.Master" AutoEventWireup="true" CodeBehind="Ext.DateField.aspx.cs" Inherits="Demo.Date.Ext_DateField" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        Ext.onReady(function () {
            var dateField = Ext.create('Ext.form.DateField', {
                width: 300,
                height: 100,
                format: 'Y-m-d',
                altFormats: 'Y-n-j|Y-m-j|Y-n-d|Ymd',
                fieldLabel: '日期选择',
                maxValue: new Date(),
                allowBlank: false,
                checkChangeBuffer:1000,
                listeners: {
                    change: function (self, newValue, oldValue, opts) {
                        if (self.validateValue(newValue)) {
                            alert(newValue);
                        }
                    },
                    blur: function () {
                        var event = window.event;
                    }
                },
                renderTo: 'content'
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content"></div>
</asp:Content>
